package client_gui;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import client_controllers.DefineTypeController;
import client_controllers.EmployeeLoginController;
import client_controllers.MarketingManagerController;
import net.miginfocom.swing.MigLayout;

import javax.swing.JButton;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.JLabel;


/**
 * @class DefineTypeGUI is used by marketing manager to edit product catalog.
 * 
 * @param elc is an instance of EmployeeLoginController.
 * @param mmg is an instance of MarketingManagerGUI.
 */
public class DefineTypeGUI extends JFrame {

	private JPanel contentPane;
	private JTextField newType;

	private JComboBox types;
	private JButton btnAddType;
	private JButton btnRemoveType;
	private JButton btnBack ;
	private JLabel lblMsg;

	
	public DefineTypeGUI(MarketingManagerController mmc, EmployeeLoginController elc) {
		setTitle("Define type Gui");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new MigLayout("", "[][][][grow][][][][][grow][][][][][][]", "[][][][][][][][][]"));
		
		lblMsg = new JLabel("msg");
		contentPane.add(lblMsg, "cell 5 0");
		lblMsg.setVisible(false);
		
		JLabel lblType = new JLabel("Type : ");
		contentPane.add(lblType, "cell 1 3");
		
		newType = new JTextField();
		contentPane.add(newType, "cell 3 3,growx");
		newType.setColumns(10);
		
		types = new JComboBox();
		contentPane.add(types, "cell 8 3,growx");
		
		btnAddType = new JButton("Add type");
		contentPane.add(btnAddType, "cell 3 4");
		
		btnRemoveType = new JButton("Remove Type");
		contentPane.add(btnRemoveType, "cell 8 4");
		
		btnBack = new JButton("Back");
		contentPane.add(btnBack, "cell 5 7");
		
		this.setVisible(true);
		DefineTypeController  dtc = new DefineTypeController(this,mmc,elc);
	}

	/*public void AddTypeLis(ActionListener lis){
		this.getBtnAddType().addActionListener(lis);
	}
	public void RemoveTypeListener(ActionListener lis){
		this.getBtnRemoveType().addActionListener(lis);
	}
	public void backListener(ActionListener lis){
		this.getBtnBack().addActionListener(lis);
	}*/
	



	public JTextField getNewType() {
		return newType;
	}



	public void setNewType(JTextField newType) {
		this.newType = newType;
	}



	public JComboBox getTypes() {
		return types;
	}



	public void setTypes(JComboBox types) {
		this.types = types;
	}



	public JButton getBtnAddType() {
		return btnAddType;
	}



	public void setBtnAddType(JButton btnAddType) {
		this.btnAddType = btnAddType;
	}



	public JButton getBtnRemoveType() {
		return btnRemoveType;
	}



	public void setBtnRemoveType(JButton btnRemoveType) {
		this.btnRemoveType = btnRemoveType;
	}



	public JButton getBtnBack() {
		return btnBack;
	}



	public void setBtnBack(JButton btnBack) {
		this.btnBack = btnBack;
	}

	public JLabel getLblMsg() {
		return lblMsg;
	}

	public void setLblMsg(JLabel lblMsg) {
		this.lblMsg = lblMsg;
	}

}
